import json

str1 = '{"key1": "v1","key2": "v2","key3": "v3", "keyList1": [{"k1": "k1v", "k2": "k2v"}, {"k3": "k3v", "k4": "k4v"}]}'
print(str1, type(str1))
jsonObject = json.loads(str1)
print(jsonObject["key1"])

with open("../data/jdComment.json", encoding="utf-8") as f1:
    jsonStr = f1.readline()
    print(jsonStr, type(jsonStr))
    jsonObject2 = json.loads(jsonStr)
    print(jsonObject2, type(jsonObject2))
    print(jsonObject2["csv"])
    for comment in jsonObject2["comments"]:
        id = comment["id"]
        nickname = comment["nickname"]
        score = comment["score"]
        content = comment["content"].replace("\n", "")
        print(id, nickname, score, content)
